package com.example.springbootdatajpa.repositories;

import com.example.springbootdatajpa.entities.Product;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;
@Repository
public interface ProductRepository extends CrudRepository<Product,Integer> {

    @Query(value = "{call sp_findBetween(:min,:max)}",nativeQuery = true)
    public List<Product> findAllBetweenStoredProcedure(@Param("min") final BigDecimal min, @Param("max") final BigDecimal max);
}
